#!/bin/sh
# Brent Smith <gnome@nextreality.net>

XMLFILE="$1"
OUTFILE=`date '+%Y%m%d.%H%M%S'`

xmllint --postvalid --xinclude --noout $NAUTILUS_SCRIPT_CURRENT_URI/$XMLFILE 2> /tmp/$OUTFILE

if [ "$?" -eq 0 ]; then
  zenity --info --text "$XMLFILE successfully validated."
else
  zenity --text-info --filename="/tmp/$OUTFILE"
fi

